Subject: Re: Parsing Data
From: [email-masked] (David McAnally)
Date: Wed, 26 Jan 94 20:01:36 MST
Newsgroups: comp.lang.rexx

In article <[email-masked]>
[email-masked] (Bud Bach) writes:
 
>
>Hi, I need to parse some data.  The data looks like:
>
>  'f1|f2|f3|f4...'
>
>where fn is field data.  My first cut at it was:
>
>  d = 'pp|t|123|John Smith|555-1212'
>  parse var d with f1 '|' f2 '|' f3 '|' f4
>  say f1 '*' f2 '*' f3 '*' f4
>
>The result was:
>
>   * pp * t * 123 * John Smith|555-1212
>
>The problem is that it seems to drop the first field.
>
>Am I doing something wrong?
>
>Is there a better way tgo do this?
>
>This is under os/2 2.1 -- Bud
>
 
Just change the parse line to either ...
 
  parse value d with f1 '|' f2 '|' f3 '|' f4
 
or...
 
  parse var d f1 '|' f2 '|' f3 '|' f4

Regards,
David McAnally
CSS Applications Engineering
Motorola